package com.learng.springcloud.service;

import com.google.common.collect.Lists;
import com.learng.springcloud.entity.Member;
import com.learng.springcloud.vo.MemberVo;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by zhouwei on 2020/7/29.
 */
@Component
public class MemberFeignFallbackService implements MemberFeignService{
    @Override
    public List<Member> getAll() {
        return Lists.newArrayList(
                Member.builder().id(999L).name("getAll fallback").age(9999).build()
        );
    }

    @Override
    public List<Member> findByCondition(MemberVo condition) {
        return Lists.newArrayList(
                Member.builder().id(999L).name("findByCondition fallback").age(9999).build()
        );
    }

    @Override
    public List<Member> findByRequestParam(Long id, String name) {
        return Lists.newArrayList(
                Member.builder().id(999L).name("findByRequestParam fallback").age(9999).build()
        );
    }

    @Override
    public List<Member> findByRequestBody(MemberVo condition) {
        return Lists.newArrayList(
                Member.builder().id(999L).name("findByRequestBody fallback").age(9999).build()
        );
    }
}
